package com.changpay.zywy.ui.activity.loan

import android.view.View
import com.changpay.zywy.R
import com.changpay.zywy.app.App
import com.changpay.zywy.base.BaseActivity
import com.changpay.zywy.base.IView
import com.changpay.zywy.ext.showToast
import com.changpay.zywy.ext.sss
import com.changpay.zywy.http.RetrofitHelper
import kotlinx.android.synthetic.main.title_layout.*

class FinishAccountSuccessActivity : BaseActivity(), IView {
    override fun showLoading() {

    }

    override fun hideLoading() {

    }

    override fun showDefaultMsg(msg: String) {
        showToast(msg)
    }

    override fun showMsg(msg: String) {
        showToast(msg)
    }

    override fun showError(errorMsg: String) {
        showToast(errorMsg)
    }


    private val onClickListener = View.OnClickListener { view ->
        when (view.id) {
            R.id.iv_back ->
            {
                val app = App.instance as App
                app.finishTopActivity(3)
            }
        }
    }

    private fun loadData() {
        val params = HashMap<String, String>()
        params["key"] = token
        params["client"] = "android"
        RetrofitHelper.service.feedback_add(params).sss(this)
        {
            showToast(it.result.toString())
            finish()
        }
    }

    override fun attachLayoutRes(): Int {
        return R.layout.activity_finish_account_success
    }

    override fun initData() {

    }

    override fun initView() {

        tv_title.text = "查账结算"
        iv_back.setOnClickListener(onClickListener)
    }

    override fun start() {

    }
}
